<template>
  <a-modal v-model:visible="visible" :hideTitle="true" :footer="false" bodyClass="profile-model" @cancel="handleCancel">
    <Profile :data="data" @close="handleCancel"></Profile>
  </a-modal>
</template>

<script setup lang="ts"> 
import { computed } from 'vue'
import Profile from './index.vue'

const props = defineProps({
  show: {
    type: Boolean,
    default: false
  },

  data: {
    type: Object,
    default: () => {}
  }
})

const visible = computed(() => props.show)

const emit = defineEmits(['update:show'])

const handleCancel = () => {
  emit('update:show', false)
}
</script>

<style lang="scss">
.arco-modal {
  width: fit-content;
}

.profile-model {
  padding: 0;
  width: 100vw;
  overflow: hidden;
}

@media (min-width: 768px) {
  .profile-model {
    max-height: calc(100vh - 160px);
    border-radius: 12px;
  }
}

@media (max-width: 767.98px) {
  .profile-model {
    border-radius: 0;
    height: 100vh;
  }
}
</style>